package com.example.demo.controller;

import com.example.demo.service.TestService;
import com.example.demo.service.impl.TestServiceImpl;
import com.sun.net.httpserver.HttpContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 测试接口
 */
@RestController
@Slf4j
@RequestMapping("test")
public class TestController {
    @Autowired
    private TestService testService;

    /**
     * 测试接口
     */
    @GetMapping("test")
    public void test() {
        try {
            testService.test();
        } catch (Exception e) {
            log.error("发生错误， 错误信息是：{}！", e.getMessage());
        }
    }

//    public static void main(String[] args) {
//
//        String limitPrice = "123245";
//
//        Boolean strResult = limitPrice.matches("-?[0-9]+(\\\\.[0-9]+)?");
//
//        System.out.println(strResult);
//
//        if(strResult) {
//            System.out.println("Is Number!");
//        } else {
//            System.out.println("Is not Number!");
//        }
//
//        System.out.println(limitPrice);
//    }


}